// 当前这个模块，API进行统一管理
import requests from './request'

import mockRequests from './mockRequest.js'

// 三级联动接口
export const reqCategoryList = ()=> requests({url:'/product/getBaseCategoryList',method:'get'})

// 获取banner（home首页轮播图接口）
export const reqGetBannerList = ()=>mockRequests.get('/banner')

// 获取floor数据
export const reqFloorList = () =>mockRequests.get('/floor')

// 获取搜索模块数据 地址为/api/list 请求方式：post 参数：需要带
export const reqGetSearchInfo = (params) =>requests({url:"/list",method:"post", data:params})

// 获取产品的详情信息接口 URL:/api/item/{skuId} get
export const repGoodsInfo = (skuId) => requests({url:`/item/${skuId}`,method:'get'})

// 添加购物车/api/cart/addToCart/{ skuId }/{ skuNum } post
export const reqAddShopCar = (skuId,skuNum) => requests({url:`/cart/addToCart/${ skuId }/${ skuNum }`,method:'post'})

// 获取购物车列表数据接口
// URL: /api/cart/cartList get
export const reqCartList = () => requests({url:'/cart/cartList',method:'get'})

// 删除购物车商品
export const reqDeleteCartById = (skuId) => requests({url:`/cart/deleteCart/${skuId}`,method: 'delete'})

// 修改商品选中状态
export const reqUpdateCheckedById =(skuId,isChecked) => requests ({url:`/cart/checkCart/${skuId}/${isChecked}`,method:'get'})